﻿using System.Windows;

namespace MagicControls.Utilities
{
    public class MCUtils
    {
        public static FrameworkElement FindMainElement(FrameworkElement currentElement)
        {
            FrameworkElement parent = currentElement.Parent as FrameworkElement;
            if (parent != null)
                return FindMainElement(parent);
            else
                return currentElement;
        }
    }
}